<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta name="format-detection" content="telephone=no"/>
    <meta content="email=no" name="format-detection"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>修改密码</title>
    <link rel="stylesheet" href="/Public/Home/css/public.css">
</head>
<body>
<div class="dz_head">
    <img src="/Public/Home/img/fh.png" onclick="javascript :history.back(-1)">
    <span>修改密码</span>
</div>
<div class="dz_main">
    <form id="myform" action="/index.php/Home/Index/uppwd.html">
        <input type="hidden" name="id" value="<?php echo session('uid');?>">
        <div>
            <input type="password" id="old" name="oldpwd" placeholder="请输入旧密码">
        </div>
        <div>
            <input type="password" id="new" name="password" placeholder="请输入新密码">
        </div>
        <div>
            <input type="password" id="agen" placeholder="再次确认密码">
        </div>
        <input type="button" id="submit" value="确认修改">
    </form>
</div>
</body>
</html>
<script src="/Public/Home/js/jquery-1.12.4.min.js"></script>
<script src="/Public/Home/js/common.js"></script>
<script>


    $("#submit").click(function () {

        var newp = $("#new").val();
        var angp = $("#agen").val();
        var oldp = $("#old").val();
        console.log(newp);
        if (angp != newp) {
            alert('两次密码不相同！！！');
            return false;
        }
        if (newp == '' || angp == '' || oldp == '') {
            alert('请填写完数据！！！');
            return;
        }
        var data = $("#myform").serialize();
        $.post("<?php echo U('Index/uppwd')?>", data, function (res) {
            alert(res.info);
            location.href = res.url;
        })
    })


</script>